<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="<?php echo site_url("style.css"); ?>" type="text/css" />
<title>Edit Current Broadcast Lineup</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>

<body>
<script language="JavaScript" type="text/JavaScript">
var xmlhttp;

function addShow()
{
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
var url="/FSU/LIS4368/final/system/application/views/updateschedule_addlist.php";
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
xmlhttp.send(null);
}

function addShowQuery()
{
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
var url="/FSU/LIS4368/final/system/application/views/updateschedule_add.php";
var total=""
for(var i=0; i < document.addshowform.addnew.length; i++){
	if(document.addshowform.addnew[i].checked){
		if(i == document.addshowform.addnew.length) {
			total +=document.addshowform.addnew[i].value
		} else {
			total +=document.addshowform.addnew[i].value + "."
		}
	}
}
url=url+"?"+total;
xmlhttp.open("GET",url,true);
xmlhttp.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
xmlhttp.send(null);
showList();
}

function removeShow()
{
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
var url="/FSU/LIS4368/final/system/application/views/updateschedule_removelist.php";
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
xmlhttp.send(null);
}

function removeShowQuery()
{
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
var url="/FSU/LIS4368/final/system/application/views/updateschedule_remove.php";
var total=""
for(var i=0; i < document.removeshowform.removenew.length; i++){
	if(document.removeshowform.removenew[i].checked){
		if(i == document.removeshowform.removenew.length) {
			total +=document.removeshowform.removenew[i].value
		} else {
			total +=document.removeshowform.removenew[i].value + "."
		}
	}
}
url=url+"?"+total;
xmlhttp.open("GET",url,true);
xmlhttp.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
xmlhttp.send(null);
showList();
}

function showList()
{
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
var url="/FSU/LIS4368/final/system/application/views/schedule_list.php";
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
xmlhttp.send(null);
}

function stateChanged()
{
if (xmlhttp.readyState==4)
{
document.getElementById("adminschedulewrapper").innerHTML=xmlhttp.responseText;
}
}

function GetXmlHttpObject()
{
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  return new XMLHttpRequest();
  }
if (window.ActiveXObject)
  {
  // code for IE6, IE5
  return new ActiveXObject("Microsoft.XMLHTTP");
  }
return null;
}
</script>
	<!-- header starts here -->
<div id="header">
  <div id="header-content"> 
    <ul>
      <li><a href="<?php echo site_url("admin/logout/"); ?>">Logout</a></li>
    </ul>
  </div>
</div>

<div id="content-wrap">
	
	<div id="nav">
		<img src="<?php echo site_url("images/Nav_Head.png"); ?>" alt="navigation header" class="no-border" />
		<a href="<?php echo site_url("review"); ?>"><img src="<?php echo site_url("images/Home_On.png"); ?>" alt="home" class="no-border" /></a>
		<a href="<?php echo site_url("review/reviews/default/0/A"); ?>"><img src="<?php echo site_url("images/Reviews_Off.png"); ?>" alt="reviews" class="no-border" /></a>
		<br />
		<div class="navlink"><a href="<?php echo site_url("admin/post/"); ?>">Add Post</a></div><br />
		<div class="navlink"><a href="<?php echo site_url("admin/add_series/"); ?>">Add Series</a></div><br />
		<div class="navlink"><a href="<?php echo site_url("admin/edit/post/0"); ?>">Edit Post/Review</a></div><br />
		<div class="navlink"><a href="<?php echo site_url("admin/edit/series/0"); ?>">Edit Series</a></div><br />
        <div class="navlink"><a href="<?php echo site_url("admin/manage_list/0"); ?>">Media Management</a></div><br />
		<div class="navlink"><a href="<?php echo site_url("admin/edit_schedule/"); ?>">Edit Schedule</a></div><br />
	</div>
		
	<div id="adminschedulewrapper">	
		
    <table width="100%">
<?php
	foreach($list as $row){
		echo "<tr><td>[$row->season $row->year] $row->name - Broadcast since $row->start</td></tr>";
	}
	
?>
	</table>
	<div align="center"><input type="button" value="Add Shows" onclick="addShow();" />&nbsp;&nbsp;&nbsp;&nbsp;
		<input type="button" value="Remove Shows" onclick="removeShow();" /></div><br /><br />	
</div>	
</div>

</body>
</html>